#include "NamedPipe.hpp"

// reader creater
int main()
{
    namedPipe fifo(creater);
    fifo.OpenPipeForRead();
    std::string message;
    message.reserve(MAXSIZE);
    while (true)
    {
        std::cout << "client say > ";
        int num = fifo.ReadForFifo(&message);
        if (num > 0)
        {
            message[num] = '\0';
            std::cout << message.c_str() << std::endl;
        }
        else
        {
            std::cout << std::endl;
            std::cout << "server quit" << std::endl;
            break;
        }
    }
    
    return 0;
}